package Arrays;

/**
 * 作者:hfj
 * 功能:206.反转链表
 * 日期: 2025/10/28 19:31
 */
public class ReverseList {

    public ListNode reverseList(ListNode head) {
        ListNode p = null;
        while (head != null){
            p = new ListNode(head.val,p);
            head = head.next;
        }
        return p;
    }
}
